package com.itmuch.demoprovider.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

//@RefreshScope
@RestController
public class ConfigTestController {
    @Value("${some-config}")
    public String someConfig;

    @Autowired
    private MyConfigProperties myConfigProperties;

    @GetMapping("/config-test")
    public String testConfig() {
        return this.someConfig;
    }


    @GetMapping("/config-test2")
    public String testConfig2() {
        return this.myConfigProperties.getTest();
    }
}
